import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/pages/layout/Layout'
Vue.use(Router)
export const constantRouterMap = [
  {
    path: '/',
    component: Layout,
    redirect: '/home/index',
    children: [
      {
        path: '/home/index',
        component: () => import('@/pages/index/index'),
        meta: { title: '主页', column: '1' }
      }
    ]
  },
  {
    path: '/product',
    component: Layout,
    children: [
      {
        path: 'index',
        name: '产品',
        component: () => import('@/pages/product/index'),
        meta: { title: '产品', column: '1' }
      }
    ]
  },
  {
    path: '/news',
    component: Layout,
    children: [
      {
        path: 'index',
        name: '新闻',
        component: () => import('@/pages/news/index'),
        meta: { title: '新闻', column: '1' }
      }
    ]
  },
  {
    path: '/about',
    component: Layout,
    children: [
      {
        path: 'index',
        name: '简介',
        component: () => import('@/pages/about/index'),
        meta: { title: '简介', column: '1' }
      }
    ]
  },
  {
    path: '/shownews',
    component: Layout,
    children: [
      {
        path: 'index',
        name: '新闻详情页',
        component: () => import('@/pages/shownews/index'),
        meta: { title: '新闻详情页', column: '2' }
      }
    ]
  },
  {
    path: '/showproduct',
    component: Layout,
    children: [
      {
        path: 'index',
        name: '产品详情页',
        component: () => import('@/pages/showproduct/index'),
        meta: { title: '产品详情页', column: '2' }
      }
    ]
  }
]
export default new Router({
  routes: constantRouterMap,
  scrollBehavior: () => ({ y: 0 })
})
